package com.coderman.infosys.plat.auth.common.behavior;

/**
 * Description:权限业务操作编码
 * date: 2022/1/8
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public enum AuthorityOpEnum implements IAppOperation{
    CREATE_AUTH_TO_ROLE("createAuthToRole","给角色授权"),
    UPDATE_AUTH_TO_ROLE("updateAuthToRole","修改角色授权"),
    CREATE_AUTH_TO_ROLEGROUP("createAuthToRoleGroup","给角色组授权"),

    ;
    private  String operationCode;

    private String operationDesc;

    AuthorityOpEnum(String operationCode,String operationDesc){
        this.operationCode = operationCode;
        this.operationDesc = operationDesc;
    }

    @Override
    public String getOperationCode() {
        return operationCode;
    }
    @Override
    public String getOperationDesc() {
        return operationDesc;
    }


    public static boolean createAuthToRole(String opCode){
        return AuthorityOpEnum.CREATE_AUTH_TO_ROLE.operationCode.equals(opCode);
    }


    public static boolean updateAuthToRole(String opCode){
        return AuthorityOpEnum.UPDATE_AUTH_TO_ROLE.operationCode.equals(opCode);
    }
}
